package cz.spock.parser.entity;

import javax.persistence.Entity;
import javax.persistence.Id;

import com.googlecode.objectify.annotation.Unindexed;

/**
 * represents triple of data pattern [startTag][content][endTag]
 *
 * is supposed to work as wrapper for tag patterns - one triplet represents basic unit which can be processed by parser
 * 
 * @author miso
 *
 */
@Entity
public class TripletPattern {

    @Id
    private Long id;
    
    private TagPattern startTag;
    
    private TagPattern endTag;
    @Unindexed
    private TagPattern content;
    
    private int weight; // the weight of pattern is used to prioritize the lists of rules
    
    private boolean allowRecursion; // this field says whether content of this pattern can also be parsed
    
    
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public boolean isAllowRecursion() {
        return allowRecursion;
    }
    public void setAllowRecursion(boolean allowRecursion) {
        this.allowRecursion = allowRecursion;
    }
    public TagPattern getStartTag() {
        return startTag;
    }
    public void setStartTag(TagPattern startTag) {
        this.startTag = startTag;
    }
    public TagPattern getEndTag() {
        return endTag;
    }
    public void setEndTag(TagPattern endTag) {
        this.endTag = endTag;
    }
    public TagPattern getContent() {
        return content;
    }
    public void setContent(TagPattern content) {
        this.content = content;
    }
    public int getWeight() {
        return weight;
    }
    public void setWeight(int weight) {
        this.weight = weight;
    }
    
    
}
